package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:52
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemAction implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("moduleId",
            com.ourteam.system.dao.ISysActionDAO.ModuleId);

        mappedDaoFields.put("actionCode",
            com.ourteam.system.dao.ISysActionDAO.ActionCode);

        mappedDaoFields.put("actionName",
            com.ourteam.system.dao.ISysActionDAO.ActionName);

        mappedDaoFields.put("id", com.ourteam.system.dao.ISysActionDAO.Id);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysActionDAO.Remarks);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysActionDAO.Status);

        mappedDaoFields.put("domainCode",
            com.ourteam.system.dao.ISysActionDAO.DomainCode);

        mappedDaoFields.put("domainName",
            com.ourteam.system.dao.ISysActionDAO.DomainName);

        mappedDaoFields.put("domainId",
            com.ourteam.system.dao.ISysActionDAO.DomainId);

        mappedDaoFields.put("moduleCode",
            com.ourteam.system.dao.ISysActionDAO.ModuleCode);

        mappedDaoFields.put("moduleName",
            com.ourteam.system.dao.ISysActionDAO.ModuleName);

        mappedDaoFields.put("actionResource",
            com.ourteam.system.dao.ISysActionDAO.ActionResource);
    }

    private com.ourteam.system.dao.SysAction sysAction;

    public SystemAction() {
        super();

        this.sysAction = new com.ourteam.system.dao.SysAction();
    }

    public SystemAction(com.ourteam.system.dao.SysAction sysAction) {
        super();

        this.sysAction = sysAction;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysAction);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysAction convertToSysAction() {
        return this.sysAction;
    }

    public com.ourteam.system.dao.SysAction convertTo() {
        return this.sysAction;
    }

    /**
     * Get moduleId
     *
     * @return long
     */
    public long getModuleId() {
        return (long) this.sysAction.getModuleId();
    }

    /**
     * Set moduleId
     *
     * @parameter long
     */
    public void setModuleId(long moduleId) {
        this.sysAction.setModuleId(moduleId);
    }

    /**
     * Get actionCode
     *
     * @return String
     */
    public String getActionCode() {
        return (String) this.sysAction.getActionCode();
    }

    /**
     * Set actionCode
     *
     * @parameter String
     */
    public void setActionCode(String actionCode) {
        this.sysAction.setActionCode(actionCode);
    }

    /**
     * Get actionName
     *
     * @return String
     */
    public String getActionName() {
        return (String) this.sysAction.getActionName();
    }

    /**
     * Set actionName
     *
     * @parameter String
     */
    public void setActionName(String actionName) {
        this.sysAction.setActionName(actionName);
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysAction.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysAction.setId(id);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysAction.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysAction.setRemarks(remarks);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysAction.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysAction.setStatus(status);
    }

    /**
     * Get domainCode
     *
     * @return String
     */
    public String getDomainCode() {
        return (String) this.sysAction.getDomainCode();
    }

    /**
     * Get domainName
     *
     * @return String
     */
    public String getDomainName() {
        return (String) this.sysAction.getDomainName();
    }

    /**
     * Get domainId
     *
     * @return long
     */
    public long getDomainId() {
        return (long) this.sysAction.getDomainId();
    }

    /**
     * Set domainId
     *
     * @parameter long
     */
    public void setDomainId(long domainId) {
        this.sysAction.setDomainId(domainId);
    }

    /**
     * Get moduleCode
     *
     * @return String
     */
    public String getModuleCode() {
        return (String) this.sysAction.getModuleCode();
    }

    /**
     * Get moduleName
     *
     * @return String
     */
    public String getModuleName() {
        return (String) this.sysAction.getModuleName();
    }

    /**
     * Get actionResource
     *
     * @return String
     */
    public String getActionResource() {
        return (String) this.sysAction.getActionResource();
    }

    /**
     * Set actionResource
     *
     * @parameter String
     */
    public void setActionResource(String actionResource) {
        this.sysAction.setActionResource(actionResource);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemAction) == false) {
            return false;
        } // end if

        SystemAction other = (SystemAction) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysAction tempSysAction = other.convertToSysAction();

        if ((tempSysAction == null) || (this.sysAction == null)) {
            isEqual = false;
        } else if ((tempSysAction == this.sysAction) ||
                tempSysAction.equals(this.sysAction)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemAction[] toArray(
        com.ourteam.system.dao.SysAction[] aSysActions) {
        return toArray(aSysActions, null);
    }

    public static SystemAction[] toArray(
        com.ourteam.system.dao.SysAction[] aSysActions,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysActions)) {
            return new SystemAction[0];
        }

        int length = aSysActions.length;

        SystemAction[] beans = new SystemAction[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemAction(aSysActions[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysActions[i] });
            }
        }

        return beans;
    }
}
